package mapping

import (
	"maya-service/model"
	"maya-service/model/entity"
)

// GameLevelsEntityToDto entity data transfer
func GameLevelsEntityToDto(gameLevels []*entity.GameLevel) []*model.GameLevelInfo {
	out := make([]*model.GameLevelInfo, 0, len(gameLevels))
	for _, c := range gameLevels {
		out = append(out, GameLevelEntityToDto(c))
	}
	return out
}

// GameLevelEntityToDto entity data transfer
func GameLevelEntityToDto(e *entity.GameLevel) *model.GameLevelInfo {
	return &model.GameLevelInfo{

		Id: e.Id,

		Desc: e.Desc,

		Weight: e.Weight,

		Type: e.Type,

		ParentId: e.ParentId,

		QuestionCount: e.QuestionCount,

		EssayQuestionCount: e.EssayQuestionCount,

		Threshold: e.Threshold,

		StarZone: e.StarZone,

		Image: e.Image,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
